<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
      <title>Моя карта</title>
      <link rel="shortcut icon" href="/favicon.ico" />
      <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
      <script type="text/javascript" src="10100ckua.js"></script>
      <script type="text/javascript">

      function isMarkerVisible() {
         return (marker.getVisible());
      }

      function fillUrls() {
         marker.setPosition(map.getCenter());
         var markerlat = null;
         var markerlng = null;
         if (isMarkerVisible()) {
            markerlat = marker.getPosition().lat();
            markerlng = marker.getPosition().lng();
         }
         var maptype = (map.getMapTypeId() == 'roadmap' ? 'map' : 'sat');
         fillUrlsCommon(map.getCenter().lat(), map.getCenter().lng(), map.getZoom(), maptype, markerlat, markerlng);
      }
      
      function processMarker() {
         if (marker.getVisible()) {
            marker.setVisible(false);
         } else {
            marker.setPosition(map.getCenter());
            marker.setVisible(true);
         }
         fillUrls();
         markerButtons();
      }
      
      
      function UpControl(controlDiv, map) {
        controlDiv.style.padding = '5px';
        // Set CSS for the control border
        var controlUI = document.createElement('DIV');
        controlUI.style.backgroundColor = 'white';
        controlUI.style.borderStyle = 'solid';
        controlUI.style.borderWidth = '2px';
        controlUI.style.cursor = 'pointer';
        controlUI.style.textAlign = 'center';
        controlUI.title = 'Click to UP the maps';
        controlDiv.appendChild(controlUI);
        // Set CSS for the control interior
        var controlText = document.createElement('DIV');
        controlText.style.fontFamily = 'Arial,sans-serif';
        controlText.style.fontSize = '22px';
        controlText.style.paddingLeft = '4px';
        controlText.style.paddingRight = '4px';
        controlText.innerHTML = '&nbsp;&nbsp;UP&nbsp;&nbsp;';
        controlUI.appendChild(controlText);
        google.maps.event.addDomListener(controlUI, 'click', function() {
          map.panBy(0, -panOffset);
          fillUrls();
        });
      }

      function DownControl(controlDiv, map) {
         controlDiv.style.padding = '5px';
         // Set CSS for the control border
         var controlUI = document.createElement('DIV');
         controlUI.style.backgroundColor = 'white';
         controlUI.style.borderStyle = 'solid';
         controlUI.style.borderWidth = '2px';
         controlUI.style.cursor = 'pointer';
         controlUI.style.textAlign = 'center';
         controlUI.title = 'Click to Down the maps';
         controlDiv.appendChild(controlUI);
         // Set CSS for the control interior
         var controlText = document.createElement('DIV');
         controlText.style.fontFamily = 'Arial,sans-serif';
         controlText.style.fontSize = '22px';
         controlText.style.paddingLeft = '4px';
         controlText.style.paddingRight = '4px';
         controlText.innerHTML = 'DOWN';
         controlUI.appendChild(controlText);
         google.maps.event.addDomListener(controlUI, 'click', function() {
           map.panBy(0, panOffset);
           fillUrls();
         });
       }
       
      function LeftControl(controlDiv, map) {
         controlDiv.style.padding = '5px';
         // Set CSS for the control border
         var controlUI = document.createElement('DIV');
         controlUI.style.backgroundColor = 'white';
         controlUI.style.borderStyle = 'solid';
         controlUI.style.borderWidth = '2px';
         controlUI.style.cursor = 'pointer';
         controlUI.style.textAlign = 'center';
         controlUI.title = 'Click to Left the maps';
         controlDiv.appendChild(controlUI);
         // Set CSS for the control interior
         var controlText = document.createElement('DIV');
         controlText.style.fontFamily = 'Arial,sans-serif';
         controlText.style.fontSize = '22px';
         controlText.style.paddingLeft = '4px';
         controlText.style.paddingRight = '4px';
         controlText.innerHTML = 'LEFT';
         controlUI.appendChild(controlText);
         google.maps.event.addDomListener(controlUI, 'click', function() {
           map.panBy(-panOffset, 0);
           fillUrls();
         });
       }

      function RightControl(controlDiv, map) {
         controlDiv.style.padding = '5px';
         // Set CSS for the control border
         var controlUI = document.createElement('DIV');
         controlUI.style.backgroundColor = 'white';
         controlUI.style.borderStyle = 'solid';
         controlUI.style.borderWidth = '2px';
         controlUI.style.cursor = 'pointer';
         controlUI.style.textAlign = 'center';
         controlUI.title = 'Click to Right the maps';
         controlDiv.appendChild(controlUI);
         // Set CSS for the control interior
         var controlText = document.createElement('DIV');
         controlText.style.fontFamily = 'Arial,sans-serif';
         controlText.style.fontSize = '22px';
         controlText.style.paddingLeft = '4px';
         controlText.style.paddingRight = '4px';
         controlText.innerHTML = 'RIGHT';
         controlUI.appendChild(controlText);
         google.maps.event.addDomListener(controlUI, 'click', function() {
           map.panBy(panOffset, 0);
           fillUrls();
         });
       }

      function ZoomInControl(controlDiv, map) {
         controlDiv.style.padding = '5px';
         // Set CSS for the control border
         var controlUI = document.createElement('DIV');
         controlUI.style.backgroundColor = 'white';
         controlUI.style.borderStyle = 'solid';
         controlUI.style.borderWidth = '2px';
         controlUI.style.cursor = 'pointer';
         controlUI.style.textAlign = 'center';
         controlUI.title = 'Click to Zoom In the maps';
         controlDiv.appendChild(controlUI);
         // Set CSS for the control interior
         var controlText = document.createElement('DIV');
         controlText.style.fontFamily = 'Arial,sans-serif';
         controlText.style.fontSize = '22px';
         controlText.style.paddingLeft = '4px';
         controlText.style.paddingRight = '4px';
         controlText.innerHTML = 'Zoom In';
         controlUI.appendChild(controlText);
         google.maps.event.addDomListener(controlUI, 'click', function() {
           map.setZoom(map.getZoom() + 1);
           fillUrls();
         });
       }

      function ZoomOutControl(controlDiv, map) {
         controlDiv.style.padding = '5px';
         // Set CSS for the control border
         var controlUI = document.createElement('DIV');
         controlUI.style.backgroundColor = 'white';
         controlUI.style.borderStyle = 'solid';
         controlUI.style.borderWidth = '2px';
         controlUI.style.cursor = 'pointer';
         controlUI.style.textAlign = 'center';
         controlUI.title = 'Click to Zoom In the maps';
         controlDiv.appendChild(controlUI);
         // Set CSS for the control interior
         var controlText = document.createElement('DIV');
         controlText.style.fontFamily = 'Arial,sans-serif';
         controlText.style.fontSize = '22px';
         controlText.style.paddingLeft = '4px';
         controlText.style.paddingRight = '4px';
         controlText.innerHTML = 'Zoom Out';
         controlUI.appendChild(controlText);
         google.maps.event.addDomListener(controlUI, 'click', function() {
           map.setZoom(map.getZoom() - 1);
           fillUrls();
         });
       }

      function RoadmapControl(controlDiv, map) {
         controlDiv.style.padding = '5px';
         // Set CSS for the control border
         var controlUI = document.createElement('DIV');
         controlUI.style.backgroundColor = 'white';
         controlUI.style.borderStyle = 'solid';
         controlUI.style.borderWidth = '2px';
         controlUI.style.cursor = 'pointer';
         controlUI.style.textAlign = 'center';
         controlUI.title = 'Click to Roadmap In the maps';
         controlDiv.appendChild(controlUI);
         // Set CSS for the control interior
         var controlText = document.createElement('DIV');
         controlText.style.fontFamily = 'Arial,sans-serif';
         controlText.style.fontSize = '22px';
         controlText.style.paddingLeft = '4px';
         controlText.style.paddingRight = '4px';
         controlText.innerHTML = 'Roadmap';
         controlUI.appendChild(controlText);
         google.maps.event.addDomListener(controlUI, 'click', function() {
           map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
           fillUrls();
         });
       }

      function HybridControl(controlDiv, map) {
         controlDiv.style.padding = '5px';
         // Set CSS for the control border
         var controlUI = document.createElement('DIV');
         controlUI.style.backgroundColor = 'white';
         controlUI.style.borderStyle = 'solid';
         controlUI.style.borderWidth = '2px';
         controlUI.style.cursor = 'pointer';
         controlUI.style.textAlign = 'center';
         controlUI.title = 'Click to Hybrid the maps';
         controlDiv.appendChild(controlUI);
         // Set CSS for the control interior
         var controlText = document.createElement('DIV');
         controlText.style.fontFamily = 'Arial,sans-serif';
         controlText.style.fontSize = '22px';
         controlText.style.paddingLeft = '4px';
         controlText.style.paddingRight = '4px';
         controlText.innerHTML = 'Hybrid';
         controlUI.appendChild(controlText);
         google.maps.event.addDomListener(controlUI, 'click', function() {
            map.setMapTypeId(google.maps.MapTypeId.HYBRID);
            fillUrls();
         });
       }
      

      function initialize() {

         initMapCanvasSize();

         var lat = getParameter('lat');
         if (lat == null || isNaN(lat))
            lat = def_lat;
         var lng = getParameter('lng');
         if (lng == null || isNaN(lat))
            lng = def_lng;
         var z = parseInt(getParameter('z'));
         if (z == null || isNaN(z))
            z = def_zoom;

         var mapType = getParameter('t');
         if (mapType == null)
            mapType = google.maps.MapTypeId.ROADMAP;
         else 
            if (mapType == 'sat')
              mapType = google.maps.MapTypeId.HYBRID;
            else 
              mapType = google.maps.MapTypeId.ROADMAP;
              
         var mlat = getParameter('mlat');
         var mlng = getParameter('mlng');
         var markerCoordinates = null;
         if (mlat != null && !isNaN(mlat) && mlng != null && !isNaN(mlng)) {
            lng = mlng;
            lat = mlat;
            markerCoordinates = new google.maps.LatLng(mlat, mlng);
         }
         
         var mapCenter = new google.maps.LatLng(lat, lng);

         
         var myOptions = {
           zoom: z,
           center: mapCenter,
           mapTypeId: mapType,
           scaleControl: true,
           scaleControlOptions: {
               position: google.maps.ControlPosition.BOTTOM_LEFT
           },
           mapTypeControl: false,
           panControl: false,
           zoomControl: false,
           streetViewControl: false,
           disableDoubleClickZoom: true,
           draggable: false,
           scrollwheel: false,
         };
         map = new google.maps.Map(document.getElementById("map_canvas"),
             myOptions);

         

         // Create the DIV to hold the control and call the UpControl() constructor
         // passing in this DIV.
         var upControlDiv = document.createElement('DIV');
         var upControl = new UpControl(upControlDiv, map);
         upControlDiv.index = 1;
         map.controls[google.maps.ControlPosition.TOP_CENTER].push(upControlDiv);

         // Create the DIV to hold the control and call the DownControl() constructor
         // passing in this DIV.
         var downControlDiv = document.createElement('DIV');
         var downControl = new DownControl(downControlDiv, map);
         downControlDiv.index = 1;
         map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(downControlDiv);

         // Create the DIV to hold the control and call the LeftControl() constructor
         // passing in this DIV.
         var leftControlDiv = document.createElement('DIV');
         var leftControl = new LeftControl(leftControlDiv, map);
         leftControlDiv.index = 2;
         map.controls[google.maps.ControlPosition.LEFT_CENTER].push(leftControlDiv);

         // Create the DIV to hold the control and call the RightControl() constructor
         // passing in this DIV.
         var rightControlDiv = document.createElement('DIV');
         var rightControl = new RightControl(rightControlDiv, map);
         rightControlDiv.index = 3;
         map.controls[google.maps.ControlPosition.RIGHT_CENTER].push(rightControlDiv);

         // Create the DIV to hold the control and call the ZoomInControl() constructor
         // passing in this DIV.
         var zoomInControlDiv = document.createElement('DIV');
         var zoomInControl = new ZoomInControl(zoomInControlDiv, map);
         zoomInControlDiv.index = 4;
         map.controls[google.maps.ControlPosition.TOP_LEFT].push(zoomInControlDiv);

         // Create the DIV to hold the control and call the ZoomOutControl() constructor
         // passing in this DIV.
         var zoomOutControlDiv = document.createElement('DIV');
         var zoomOutControl = new ZoomOutControl(zoomOutControlDiv, map);
         zoomOutControlDiv.index = 5;
         map.controls[google.maps.ControlPosition.LEFT_TOP].push(zoomOutControlDiv);


         // Create the DIV to hold the control and call the RoadmapControl() constructor
         // passing in this DIV.
         var roadmapControlDiv = document.createElement('DIV');
         var roadmapControl = new RoadmapControl(roadmapControlDiv, map);
         roadmapControlDiv.index = 5;
         map.controls[google.maps.ControlPosition.TOP_RIGHT].push(roadmapControlDiv);

         // Create the DIV to hold the control and call the HybridControl() constructor
         // passing in this DIV.
         var hybridControlDiv = document.createElement('DIV');
         var hybridControl = new HybridControl(hybridControlDiv, map);
         hybridControlDiv.index = 5;
         map.controls[google.maps.ControlPosition.RIGHT_TOP].push(hybridControlDiv);

         
         // MARKER
         marker = new google.maps.Marker({
            map: map,
            draggable: false,
            position: markerCoordinates,
            visible: (markerCoordinates != null ? true : false)
          });
          

          fillUrls();

          initMarkerButtons(marker.getVisible());
          //initStyleButtons();
          
       }
      
      function resizeMap() {
         google.maps.event.trigger(map, 'resize');
         fillUrls();
      }

      </script>
      <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-1390959-7']);
        _gaq.push(['_trackPageview']);
        (function() {
          var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
          ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
      </script>
   </head>
   <body onload="initialize()">

      <div id="map_canvas" style="width: 500px; height: 300px"></div>

      <div id="div_url" style="width: 500px; height: 65px">
         <br/>
         <a href="" id="refresh" >Обновить</a>&nbsp;
         <input id="textlink" value="" title="Адрес карты" size="60" type="text" maxlength="2048" 
            spellcheck="false" style="width: 500px;"/><br/>
      </div>
      <div id="map_links" style="width: 500px; height: 120px">
         <table border="0" cellpadding="10" cellspacing="0">
            <tr valign="top">
            <td><a href="google-maps.html" id="google-maps">
               <img border="0" src="images/google.jpg"><br/>
               google</a><br/></td>
            <td><a href="yandex-maps.html" id="yandex-maps" >
               <img border="0" src="images/yandex.jpg"><br/>
               yandex</a><br/></td>
            <td><a href="visicom-maps.html" id="visicom-maps" >
               <img border="0" src="images/visicom.jpg"><br/>
               visicom</a><br/></td>
            <td><a href="google-maps-mobile.html" id="google-maps-mobile">
               <img border="0" src="images/google.jpg"><br/>
               google<br/> mobile</a><br/></td>
            </tr>
         </table>
      </div>
      <form> 
         <input id="setmarker" type="button" value="Поставить маркер" name="button1" onClick="processMarker()">
         <input id="removemarker" type="button" value="Убрать маркер" name="button2" onClick="processMarker()">  
      </form>
      <br/>
      <form>
         <input id="resizeMicro" type="button" value="Размер микро" name="button0" onClick="resizeMap0()">
         <input id="resizeNormal" type="button" value="Размер A" name="button1" onClick="resizeMapA()">
         <input id="resizeLarge" type="button" value="Размер B" name="button2" onClick="resizeMapB()">
         <input id="resizeCurrent" type="button" value="Размер экрана" name="button3" onClick="resizeMapMax()">
      </form>
      
   </body>

</html>

